package com.umeox.iqibla.azkar.utils

import android.os.SystemClock
import android.view.View

/**
 * Created by Rambo 2024/3/28/0028
 * Describe:
 */
abstract class OnNoDoubleClickListener : View.OnClickListener{

    private val MIN_CLICK_DELAY_TIME = 100
    private var lastClickTime: Long = 0
    override fun onClick(v: View?) {
        val currentTime = SystemClock.elapsedRealtime()
        if (currentTime - lastClickTime > MIN_CLICK_DELAY_TIME) {
            lastClickTime = currentTime
            onNoDoubleClick(v)
        }
    }

    protected abstract fun onNoDoubleClick(v: View?)
}